﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Teacher.Master" AutoEventWireup="true" CodeBehind="TeacherStuMan.aspx.cs" Inherits="WebSystem.TeacherStuMan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">

        .auto-style1 {
            width: 100%;
        }
        

        .auto-style1 {
            width: 100%;
        }
        .auto-style16 {
            height: 37px;
        }
        .auto-style4 {
            text-align: right;
            height: 23px;
            width: 304px;
        }
        .auto-style5 {
            width: 223px;
            text-align: left;
            height: 23px;
        }
        .auto-style6 {
            height: 23px;
        }
        .auto-style10 {
            text-align: right;
            height: 20px;
        }
        .auto-style11 {
            width: 223px;
            text-align: left;
            height: 20px;
        }
        .auto-style12 {
            height: 20px;
        }
        .auto-style7 {
            text-align: right;
            width: 304px;
            height: 27px;
        }
        .auto-style8 {
            width: 223px;
            text-align: left;
            height: 27px;
        }
        .auto-style9 {
            height: 27px;
        }
        .auto-style17 {
            text-align: right;
            width: 304px;
            height: 25px;
        }
        .auto-style18 {
            width: 223px;
            text-align: left;
            height: 25px;
        }
        .auto-style19 {
            height: 25px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p>
        &nbsp;</p>
    <p>
    <table class="auto-style1">
        <tr>
            <td colspan="3" style="text-align: center" class="auto-style16">
                <asp:Label ID="Label1" runat="server" Font-Size="XX-Large" Text="成绩管理"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="auto-style4">
                <asp:Label ID="lblSno" runat="server" Text="学号"></asp:Label>
            </td>
            <td class="auto-style5">
                <asp:TextBox ID="txtSno" runat="server"></asp:TextBox>
                <asp:Label ID="Label3" runat="server" ForeColor="Red" Text="*"></asp:Label>
                <br />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSno" ErrorMessage="！学号不能为空" Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            </td>
            <td class="auto-style6">
                <asp:Button ID="btnOut" runat="server" OnClick="btnOut_Click" style="height: 21px" Text="显示数据" />
&nbsp;&nbsp;
                <asp:Button ID="btnDel" runat="server" OnClick="btnDel_Click" Text="删除数据" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
        </tr>
        <tr>
            <td class="auto-style10">
                <asp:Label ID="lblCno" runat="server" Text="课程编号"></asp:Label>
            </td>
            <td class="auto-style11">
                <asp:TextBox ID="txtCno" runat="server"></asp:TextBox>
                <asp:Label ID="Label4" runat="server" ForeColor="Red" Text="*"></asp:Label>
                <br />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCno" ErrorMessage="！课程号不能为空" Font-Size="Small" ForeColor="Red"></asp:RequiredFieldValidator>
            </td>
            <td class="auto-style12">
                <asp:Button ID="Button6" runat="server" OnClick="Button5_Click" Text="重置" />
            </td>
        </tr>
        <tr>
            <td class="auto-style10">
                <asp:Label ID="lblSco" runat="server" Text="成绩"></asp:Label>
            </td>
            <td class="auto-style11">
                <asp:TextBox ID="txtSco" runat="server"></asp:TextBox>
            </td>
            <td class="auto-style12">&nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style7"></td>
            <td class="auto-style8">
                <asp:Button ID="btnUpd" runat="server" OnClick="btnUpd_Click" Text="更新数据" />
&nbsp;<asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="增加数据" />
&nbsp;&nbsp;&nbsp; </td>
            <td class="auto-style9">
                <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="显示新成绩表" />
            </td>
        </tr>
        <tr>
            <td class="auto-style17"></td>
            <td class="auto-style18">
                <asp:Label ID="lblInfo" runat="server" ForeColor="Red"></asp:Label>
            </td>
            <td class="auto-style19"></td>
        </tr>
        <tr>
            <td class="auto-style10">
                <asp:Label ID="Label2" runat="server" Text="输入班级"></asp:Label>
                </td>
            <td class="auto-style11">
                <asp:TextBox ID="txtCno1" runat="server"></asp:TextBox>
                </td>
            <td class="auto-style12">
                <asp:Button ID="BTN" runat="server" OnClick="BTN_Click" Text="显示成绩" />
            </td>
        </tr>
        <tr>
            <td class="auto-style10" colspan="3">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Sno,Cno" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="BTN_Click">
                    <Columns>
                        <asp:BoundField DataField="Sno" HeaderText="学号" ReadOnly="True" SortExpression="Sno" />
                        <asp:BoundField DataField="Sname" HeaderText="姓名" SortExpression="Sname" />
                        <asp:BoundField DataField="Cno" HeaderText="课程编号" ReadOnly="True" SortExpression="Cno" />
                        <asp:BoundField DataField="grade" HeaderText="成绩" SortExpression="grade" />
                        <asp:BoundField DataField="Classno" HeaderText="班级" SortExpression="Classno" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:dhd2014115121ConnectionString %>" DeleteCommand="DELETE FROM [Score] WHERE [Sno] = @original_Sno AND [Cno] = @original_Cno AND (([Sname] = @original_Sname) OR ([Sname] IS NULL AND @original_Sname IS NULL)) AND (([grade] = @original_grade) OR ([grade] IS NULL AND @original_grade IS NULL)) AND (([Classno] = @original_Classno) OR ([Classno] IS NULL AND @original_Classno IS NULL))" InsertCommand="INSERT INTO [Score] ([Sno], [Sname], [Cno], [grade], [Classno]) VALUES (@Sno, @Sname, @Cno, @grade, @Classno)" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [Score] WHERE ([Classno] = @Classno)" UpdateCommand="UPDATE [Score] SET [Sname] = @Sname, [grade] = @grade, [Classno] = @Classno WHERE [Sno] = @original_Sno AND [Cno] = @original_Cno AND (([Sname] = @original_Sname) OR ([Sname] IS NULL AND @original_Sname IS NULL)) AND (([grade] = @original_grade) OR ([grade] IS NULL AND @original_grade IS NULL)) AND (([Classno] = @original_Classno) OR ([Classno] IS NULL AND @original_Classno IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_Sno" Type="String" />
                        <asp:Parameter Name="original_Cno" Type="String" />
                        <asp:Parameter Name="original_Sname" Type="String" />
                        <asp:Parameter Name="original_grade" Type="Int32" />
                        <asp:Parameter Name="original_Classno" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Sno" Type="String" />
                        <asp:Parameter Name="Sname" Type="String" />
                        <asp:Parameter Name="Cno" Type="String" />
                        <asp:Parameter Name="grade" Type="Int32" />
                        <asp:Parameter Name="Classno" Type="String" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtCno1" Name="Classno" PropertyName="Text" Type="String" />
                    </SelectParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Sname" Type="String" />
                        <asp:Parameter Name="grade" Type="Int32" />
                        <asp:Parameter Name="Classno" Type="String" />
                        <asp:Parameter Name="original_Sno" Type="String" />
                        <asp:Parameter Name="original_Cno" Type="String" />
                        <asp:Parameter Name="original_Sname" Type="String" />
                        <asp:Parameter Name="original_grade" Type="Int32" />
                        <asp:Parameter Name="original_Classno" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                </td>
        </tr>
    </table>
        <br />
    </p>
                <p>
                    &nbsp;</p>
    <p>
        &nbsp;</p>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</p>
    <p>
        &nbsp;</p>
    <p style="text-align: center">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</p>
    <p>
        &nbsp; &nbsp;</p>
    <p>
    &nbsp;&nbsp;
    <br />
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
</asp:Content>
